#include <stdio.h>

int main() {
    char str[] = "123";
    char *p = str;
    int num = 0;

    while (*p != '\0') {
        num = num * 10 + (*p - '0');
        p++;
    }
    
    printf("转换结果: %d\n", num);
    return 0;
}